<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover">
		<title></title>
		<link rel="stylesheet" href="../../css/mui.min.css">
		<link rel="stylesheet" href="../../css/app.css">
		<link rel="stylesheet" href="../../css/waves.min.css">
		<style>
			body{background: #f3f3f3;}
			.mui-bar-nav{background-color: #0B7EFD;}
			.info{ float: left; width: 100%; background: #fff;overflow: hidden;}
			.mt15{ margin-top: 1.1rem;}
			.mt16{ margin-top: .2rem;}
			.info ul{width: 100%;padding: 0 !important;margin: 0 !important;margin-top:0rem !important;}
			.info ul li{ float: left;font-size: 0.30rem;line-height: 1rem;width: 100%;height: 0.94rem;background: #fff;/*border-bottom: 1px solid #eeeeee;*/ position: relative; padding-left: .1rem;box-sizing: border-box;}
			.info ul li:after{position: absolute;right: 0;bottom: 0;left: 15px;height: 1px;content: '';-webkit-transform: scaleY(.2);transform: scaleY(.2);background-color: #c8c7cc;}
			.info ul li a{ width:6rem ; display: inline-block;color: #414141; box-sizing: border-box;}
			.info ul a:after {right: 15px; content: '\e583';font-family: Muiicons;font-size: inherit;line-height: 1;position: absolute;top: 50%;display: inline-block;-webkit-transform: translateY(-50%);transform: translateY(-50%);text-decoration: none;color: #bbb;-webkit-font-smoothing: antialiased;}
			.encrypted_box:after {right: 15px; content: '\e583';font-family: Muiicons;font-size: inherit;line-height: 1;position: absolute;top: 50%;display: inline-block;-webkit-transform: translateY(-50%);transform: translateY(-50%);text-decoration: none;color: #bbb;-webkit-font-smoothing: antialiased;}
            .info>ul>li>span{ float: left; width:.6rem; display: inline-block;height: 0.94rem;}
			.icon1{background: url("../../images/menu/amend.png") no-repeat center center; background-size:.28rem .28rem;}
			.icon2{background: url("../../images/menu/tel.png") no-repeat center center; background-size:.18rem .30rem;}
			.icon3{background: url("../../images/menu/update.png") no-repeat center center; background-size:.24rem .26rem;}
			.icon4{background: url("../../images/menu/email.png") no-repeat center center; background-size:.28rem .22rem;}
			.info ul a:last-child{border-bottom: none;}
			.info .icon{width: 0.58rem;height: 100%;background: #fff;position: absolute;top: 0;}
			.info .icon div{width: 0.32rem;height: 0.32rem;background-size: contain;position: absolute;left: 0.21rem;}
			/*.info ul a b{position: absolute;right: 0.35rem;color: #c7c7cc;}*/
			.info ul a .portrait{position: absolute;top: 0.07rem;right:0.68rem ;width: 0.78rem;height: 0.78rem;}
			.info ul a .btn{width: 1.1rem;height: 0.4rem;color: #999999;font-size: 0.24rem;position: absolute;top: 0.28rem;right:0.71rem;line-height: 0.4rem;text-align: center;}
			.info ul a span{position: absolute;right: 0.71rem;color: #999999;font-size: 0.26rem;}
			
			.encrypted_box{display: block; font-size: 0.28rem;color: #414141 !important;line-height: 1rem;padding-left: 0.67rem;width: 100%;height: 0.96rem;background: #fff;position: absolute;top: 5.45rem;left: 0;}
			.encrypted_box .icon_encrypted{width: 0.32rem;height: 0.32rem;background: url(../../images/menu/encrypted.png) no-repeat center center;background-size: contain;position: absolute;top: 0.35rem;left: 0.24rem;}
			.encrypted_box b{position: absolute;right: 0.35rem;color: #c7c7cc;}
			.encrypted_box span{position: absolute;right: 0.71rem;color: #999999;font-size: 0.26rem;}

			.select-box{width: 100%;height: 1.98rem;background: #fff;position: absolute;bottom: 0;}
			.select-box ul{margin: 0 !important;padding: 0 !important;}
			.select-box ul li{border-bottom: 1px solid #eeeeee;height: 0.86rem;text-align: center;color: #265efc;line-height: 0.86rem;}
			.select-box ul li:last-child{border-bottom: none; color: #333333;}
			.select-box ul li:first-child,.select-box ul li:last-child{height: 0.95rem;line-height: 0.95rem !important;}
			.mask{display: none;}
			.info2{width: 100%;height: 2.8rem;background: #fff;position: absolute;top: 5.43rem;left: 0;overflow: hidden;}
			.info2 ul{width: 100%;height: 2.8rem;padding: 0 !important;margin: 0 !important;}
			.info2 ul a{display: block;font-size: 0.28rem;color: #414141;line-height: 1rem;padding-left: 0.67rem;width: 100%;height: 0.94rem;background: #fff;border-bottom: 1px solid #EEEEEE;position: relative;}
			.info2 ul a:after {right: 15px; content: '\e583';font-family: Muiicons;font-size: inherit;line-height: 1;position: absolute;top: 50%;display: inline-block;-webkit-transform: translateY(-50%);transform: translateY(-50%);text-decoration: none;color: #bbb;-webkit-font-smoothing: antialiased;}
			.encrypted_box:after {right: 15px; content: '\e583';font-family: Muiicons;font-size: inherit;line-height: 1;position: absolute;top: 50%;display: inline-block;-webkit-transform: translateY(-50%);transform: translateY(-50%);text-decoration: none;color: #bbb;-webkit-font-smoothing: antialiased;}

			.info2 ul a:last-child{border-bottom: none;}
			.info2 .icon{width: 0.58rem;height: 100%;background: #fff;position: absolute;top: 0;}
			.info2 .icon div{width: 0.32rem;height: 0.32rem;background-size: contain;position: absolute;left: 0.21rem;}
			.icon5{background: url("../../images/menu/about.png") no-repeat center center; background-size:.32rem .32rem;}
			.icon6{background: url("../../images/menu/share.png") no-repeat center center; background-size:.28rem .28rem;}
			.icon7{background: url("../../images/menu/introduce.png") no-repeat center center;  background-size:.28rem .28rem;}
			.submit{width: 6rem;height: 0.68rem;background: #117afd;font-size: 0.3rem;color: #fff;border: none;outline: none;position: absolute !important;top: 9.39rem  !important;left: 0.75rem !important;border-radius: 0.1rem;}
		</style>
	</head>
	<body>
		<div class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">系统设置</h1>
		</div>
		<div class="info mt16" id="app">
			<ul>
				<li id="changePwd">
					<span class="icon1"></span>
					<a href="#">修改密码</a>
				</li>
				<!--<li>
					<span class="icon2"></span>
				<a href="#" class="portrait_box">
					清空缓存
					
					<div class="btn">100M</div>
				</a>
				</li>-->
				<template v-if="isAndroid">
				<li id="checkupdate">
					<span class="icon3"></span>
					<a href="#">检测更新
						<span id="hasNew">已是最新版本</span>
					</a>
				</li>
				</template>
				<li id="feedback">
					<span class="icon4"></span>
					<a href="#">
						意见反馈
					</a>
				</li>
			</ul>
		</div>
		<div class="info mt16">
			<ul>
				<li id="aboutus">
					<span class="icon5"></span>
					<a href="#">关于我们</a>
				</li>
				<template v-if="isAndroid">
				<li id="share">
					<span class="icon6"></span>
					<a href="#">推荐分享</a>
				</li>
				</template>
				<!--<li>
					<span class="icon7"></span>
					<a href="#">功能介绍</a>
				</li>-->
			</ul>
		</div>
		<!--<button id="exit" class="waves-effect waves-button waves-button-input">退出</button>-->
		<button id="exit" class="waves-effect waves-button waves-float" style="background-color: red;height: 40px;color:#fff;width: 6rem;margin: .8rem auto;display: block; line-height: 5px;">退出</button>
		<!--<div class="mui-backdrop mask">
			<div class="select-box">
				<ul>
					<li>已清除100M缓存</li>
					<li class="close">取消</li>
				</ul>
			</div>
		</div>-->
	</body>
	<script>
		function my_immersed(immersed){
			document.querySelector(".mui-bar-nav").style.paddingTop = immersed + 'px';
			document.querySelector(".mui-bar-nav").style.height = (44 + immersed) + 'px';
			document.getElementById("app").style.marginTop = (44 + immersed) + 'px';
		}
	</script>
	<script src="../../js/immersed.js"></script>
	<script src="../../js/mui.min.js"></script>
	<script src="../../js/common.js"></script>
	<script src="../../js/app.js"></script>
	<script src="../../js/update.js"></script>
	<script src="../../js/vue.min.js"></script>
	<script src="../../js/waves.min.js"></script>
	<script>
		/*var portrait = document.querySelector('.portrait_box');
		var mask = document.querySelector('.mask');
		var close = document.querySelector('.close');
		portrait.onclick = function(){
			mask.style.display='block';
		}
		close.onclick = function(){
			mask.style.display='none';
		}*/
		var vm = new Vue({
			el:'#app',
			data:{isAndroid:false}
		})
		mui.init();
		
	   //修改密码
       document.getElementById("changePwd").addEventListener('tap',function(){
		  showTemplates('changepwd','修改密码','../setting/changepwd.html');
	   })
	   var lastClickTime = null;
	   //检查更新
	   mui.plusReady(function(){
			var updateInfo = JSON.parse(localStorage.getItem('$updateInfo'));
			var update = updateInfo || {};
			if(update.hasNew && update.hasNew == '1' ){
				if(document.getElementById('hasNew'))
				document.getElementById('hasNew').innerText = '有新版本哦';
			}
			if(plus.os.name.toLowerCase() == 'android'){
				vm.isAndroid = true;
				setTimeout(function(){
					document.getElementById('checkupdate').addEventListener('tap',function(){
						var d = new Date();
						if(lastClickTime &&  (d.getTime() - lastClickTime <1000)  ){
							return null;
						}
						lastClickTime = d.getTime();
						
						checkUpdate(true,function(data){
							if(data){	
								if(document.getElementById('hasNew'))
								document.getElementById('hasNew').innerText = '有新版本哦';
							}
						});
					},false);
				},200);
			}else{
				vm.isAndroid = false;
			}
			closeWaitingAndShowView();
		})
	     
       //意见反馈
       document.getElementById("feedback").addEventListener('tap',function(){
		  showTemplates('feedback','意见反馈','../setting/feedback.html');
	   })
       
       //关于我们
       document.getElementById("aboutus").addEventListener('tap',function(){
		 showTemplates('aboutus','关于我们','../setting/aboutus.html');
	  })	
	  
	   //分享链接点击事件-安卓
	   if(document.getElementById("share")){
		   	document.getElementById("share").addEventListener('tap', function() {
		   		utils.showWaiting();
		        var osType = 1;//ios
				if(plus.os.name == 'Android'){
					osType = 0;
				}
				var param = "apkType=" + osType;
				utils.ajax('appHttpService/getApkPath.do', function(data) {
					data = JSON.parse(data);
					if(data.state == '0' || data.state == 0){//获取apk地址
						var shareText = data.url;
						var shareTip = "推荐分享";
					 	share(shareTip, shareText)		
					}else if(data.state == '-1' || data.state == -1){//获取apk地址异常
						mui.toast(data.msg);
					}
				}, param);		  			
				
			});
	   }
	   
		
	   //退出操作
		document.getElementById('exit').addEventListener('tap', function() {
			var btnArray = [{
				title: "注销当前账号"
			}];
			
			if(plus.os.name == "Android"){
				var quit = {title: "直接关闭应用"};
				btnArray.push(quit);
			}
			
			plus.nativeUI.actionSheet({
				cancel: "取消",
				buttons: btnArray
			}, function(event) {
				var index = event.index;
				switch (index) {
					case 1:
						removeState();//移除登录状态
						//移除头像 如果有
						localStorage.removeItem('headDir');
						utils.showWaiting();
						var app_index = plus.webview.getLaunchWebview();
						mui.fire(app_index,'loginRefresh',{'flag':2});						
						break;
					case 2:
						plus.runtime.quit();
						break;
				}
			});
		}, false);
		
		Waves.displayEffect();
	</script>
</html>